import { DataModelVersionType, ServiceType, ServiceVersionType, ThingType } from '@coolphk/shared-types/low-code'

export const mockServices: ServiceType[] = [
  {
    id: '1', // 服务ID
    name: '获取患者信息列表', // 服务名称
    code: 'getPatientInfoList', // 服务编码
    description: 'string', // 服务描述
    method: 'GET', // 服务方法
    thingId: '200', //
    currentVersionId: '1',
  },
  /*{
    id: 2, // 服务ID
    name: '获取医院信息', // 服务名称
    code: 'getHospitalInfo', // 服务编码
    description: 'string', // 服务描述
    method: 'GET', // 服务方法
    thingId: 200, //
    currentVersionId: 3,
  },*/
]
export const mockThings: ThingType[] = [{
  id: '200',
  name: '门诊医嘱',
  code: 'mzyz',
  'description': '门诊医嘱',
  services: mockServices,
}]


export const mockServiceVersions: ServiceVersionType[] = [
  {
    id: '1',
    inputModelVersionId: null,
    outputModelVersionId: '1',
    version: '1',
    scriptVersionId: '1',
    serviceId: '1',
  },
  {
    id: '2',
    inputModelVersionId: null,
    outputModelVersionId: '2',
    version: '2',
    scriptVersionId: '1',
    serviceId: '1',
  },
]

export const mockDataModels: DataModelVersionType[] = [
  {
    id: '1',
    name: '患者信息',
    description: '患者信息',
    version: '1',
    schema: {
      root: {
        type: 'object',
        title: '患者信息',
        properties: {
          name: {
            type: 'string',
            title: '姓名',
            defaultValue: '张三',
          },
          age: {
            type: 'number',
            title: '年龄',
            defaultValue: 18,
          },
        },
      },
    },
  },
  {
    id: '2',
    name: '患者信息',
    description: '患者信息',
    version: '2',
    schema: {
      root: {
        type: 'object',
        title: '患者信息',
        properties: {
          name: {
            type: 'string',
            title: '患者姓名',
            defaultValue: '张三',
          },
          userAge: {
            type: 'object',
            title: '用户年龄',
            defaultValue: 18,
            properties: {
              age: {
                type: 'number',
                title: '年龄',
                defaultValue: 18,
              },
            },
          },
          sex: {
            type: 'string',
            title: '性别',
            defaultValue: '男',
          },
        },
      },
    },
  },
]

export const mockSchemaData = {
  rows: [{
    name: '张三',
    age: 18,
  }, {
    name: '李四',
    age: 20,
  }],
}

